package com.wing.device.model.response;

import com.wing.mybatis.common.BaseEntity;
import com.wing.utils.ExcelExport;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.wing.device.model.entity.Device;

/**
 * 设备表VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class DeviceVO extends BaseEntity {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @ExcelExport(value = "添加时间", sort = 12)
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime createTime;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    @ExcelExport(value = "录入人", sort = 11)
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 设备名称
     */
    @ExcelExport(value = "设备名称", sort = 5)
    private String name;

    /**
     * 设备分类
     */
    private Long categoryId;
    @ExcelExport(value = "设备分类", sort = 3)
    private String categoryName;

    /**
     * 设备类型
     */
    private Long deviceType;
    @ExcelExport(value = "设备类型", sort = 1)
    private String deviceTypeName;

    /**
     * 排序
     */
    private Integer sortNumber;

    /**
     * 设备品牌ID
     */
    private Long deviceBrandId;
    @ExcelExport(value = "设备品牌", sort = 3)
    private String deviceBrandName;

    /**
     * 设备型号ID
     */
    private Long deviceModelId;
    @ExcelExport(value = "设备型号", sort = 2)
    private String deviceModelName;

    /**
     * 设备编码
     */
    @ExcelExport(value = "设备编码", sort = 6)
    private String deviceCode;

    /**
     * 设备照片
     */
    private String devicePic;

    /**
     * 设备加工工艺ID
     */
    private Long workmanshipId;

    private String workmanshipName;

    /**
     * 可加工材料ID
     */
    private Long canMachinableMaterialsId;
    /**
     * 设备厂家
     */
    private String factoryName;

    /**
     * 供应商名称
     */
    @ExcelExport(value = "供应商", sort = 8)
    private String supplierName;
    /**
     * 部门名称
     */
    @ExcelExport(value = "所属部门", sort = 8)
    private String departmentName;
    /**
     * 部门名称
     */
    @ExcelExport(value = "所属企业", sort = 8)
    private String enterpriseName;

    /**
     * 设备状态
     */
    @ExcelExport(value = "状态",sort = 10,kv = "normalUse-设备正常;exception-设备异常)")
    private Device.Status status;

    /**
    * 设备状态描述
    */
    @TableField(exist = false)
    private String statusDesc;

    public String getStatusDesc() {
        if (this.status!=null){
            return status.getDesc();
        }
        return null;
    }

    /**
     * 供应商网址
     */
    private String supplierUrl;

    /**
     * 采购合同
     */
    private String contractOfPurchase;
    /**
     * 供应商电话
     */
    private String supplierPhone;

    /**
     * 供应商地址
     */
    private String supplierAddress;
    /**
     * 供应商联系
     */
    private String supplierContact;

    private String supplierContactId;


    /**
     * 附件url
     */
    private String enclosureUrl;
    @ExcelExport(value = "备注", sort = 9)
    private String remark;

    /**
     * 车间id
     */
    private Long workshopId;

    /**
     * 车间名称
     */
    @ExcelExport(value = "所属车间", sort = 7)
    private String workshopName;

    /**
     * 供应商id
     */
    private Long supplierId;

    /**
     * 企业ID
     */
    private Long companyInfoId;

    /**
     * 部门ID
     */
    private Long departmentId;



    /**
     * 角色名称
     */
    private String roleName;
    private String deviceName;
    private String deviceModel;


    /**
     * 设备编码
     */
    @ExcelExport(value = "资产编码", sort = 6)
    private String propertyCode;
    private String companyInfoName;

    /**
     * 设备价格
     */
    private Double devicePrice;

    /**
     * 折旧时间
     */
    private LocalDateTime depreciationTime;

    /**
     * 折旧价
     */
    private Double depreciationPrice;

    /**
     * 折旧时长
     */
    private Integer depreciationDuration;

    private LocalDateTime inspectTime;
    private LocalDateTime inspectNextTime;
    private Integer inspectCycle;
    private LocalDateTime maintenanceTime;
    private LocalDateTime maintenanceNextTime;
    private Integer maintenanceCycle;

    /**
     * 设备SOP资料
     */
    private String referenceUrl;
    /**
     * 设备操作说明
     */
    private String directionUrl;
    /**
     * 其他附件资料
     */
    private String otherUrl;

    private String deviceAppendix;

    private String faceCode;

    /**
     * 设备性质
     */
    private String deviceMentName;

}
